#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>

int main()
{
	int n, t;
	int result = 0;
	int sum = 1;
	scanf("%d %d", &n, &t);
	int* a;
	a = (int*)malloc(sizeof(int) * (n-1));
	for (int i = 0; i < n - 1; i++) {
		scanf("%d", &a[i]);
	}
	for (int j = 0; j < n - 1; j++) {
		if (j + 1 == sum) {
			sum = sum+a[j];
		}

		else
			continue;
		if (sum == t) {
			result = 1;
			break;
		}
	}
	if (result == 0)
		printf("NO");
	else
		printf("YES");
	free(a);
	return 0;
}